package com.cebbank.yyi.springbootapp.jingtang.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public enum DocBaseTypeEnum {


    FILE_LAST_ID("fileLastId", "REPEAL_PARENT_DOC", "同时废止上级文件"),
    RULE_ID("ruleId", "COM_RELATION", "公司级规章制度");

    private final String type;

    private final String name;

    private final String desc;

    public static DocBaseTypeEnum getByType(String type) throws Exception {
        for (DocBaseTypeEnum e : DocBaseTypeEnum.values()) {
            if (e.type.equals(type)) {
                return e;
            }
        }
        throw new Exception("DocBaseTypeEnum：映射失败，当前TYPE为：" + type);
    }

}
